package com.bitejiuyeke.job_publish.controller;

import com.bitejiuyeke.job_publish.common.AppResult;
import com.bitejiuyeke.job_publish.model.College;
import com.bitejiuyeke.job_publish.service.ICollegeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author 比特就业课
 */
// 日志
@Slf4j
// API描述
@Tag(name = "公共数据接口", description = "所有的公共数据在统一在这个控制器中处理")
// Controller注解，返回的对象用JSON形式表示
@RestController
// 路径映射
@RequestMapping("/common")
public class CommonController {

    @Resource
    private ICollegeService collegeService;

    /**
     * 获取所有院系信息及关联专业
     * @return
     */
    @Operation(summary = "获取所有院系信息及关联专业")
    @GetMapping("/colleges")
    public AppResult<List<College>> colleges () {
        List<College> result = collegeService.selectAllInfo();
        return AppResult.success(result);
    }

}
